c++, win 32 , Erase text using TextOut or DrawText [on hold]

Posted by XXXXX on Programmers See other posts from Programmers or by XXXXX
Published on 2013-11-01T14:35:20Z Indexed on 2013/11/01 16:19 UTC
Read the original article Hit count: 264

Filed under:
|

How to erase the inputted character on the window and to write the another one on its place??? Say, for example, d d d d was inputted, I want to redraw it to d j j f
I'm trying to do this in the following way:
TextOut(hdc,rect.right,rect.top,(LPCWSTR)" ",2);
DrawText( hdc, (LPCWSTR)str, -1, &rect, DT_SINGLELINE | DT_NOCLIP ) ;

or

DrawText( hdc, (LPCWSTR)" ", -1, &rect, DT_SINGLELINE | DT_NOCLIP ) ;
DrawText( hdc, (LPCWSTR)str, -1, &rect, DT_SINGLELINE | DT_NOCLIP ) ;

Anyway, some characters are redrawn, and in some cases(f, j,i characters) the junks are seen(one character is just drawn on another).
I haven't set the SetBkMode to transparent.
What to do?>
Thanks much in advance!!!

© Programmers or respective owner

Related posts about c++

Related posts about visual-c++